package Eyjafjalla.card.skill;

import Eyjafjalla.action.MakeTempCardInCloudAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.modcore.EyjafjallaTag;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInHandAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class ResonanceDefend_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "ResonanceDefend_Eyjafjalla";
    private static final CardStrings cardStrings;

    public ResonanceDefend_Eyjafjalla(){
        super(ID, cardStrings.NAME,1,cardStrings.DESCRIPTION,CardType.SKILL,CardRarity.COMMON,CardTarget.SELF);
        this.baseBlock = 8;
        this.block = 8;
        this.tags.add(EyjafjallaTag.HEART_EYJAFJALLA);
        this.cardsToPreview = new Marshmallow_Eyjafjalla();
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new ResonanceDefend_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new GainBlockAction(p,this.block));
        if(isFire()){
            addToBot(new MakeTempCardInCloudAction(getCard()));
        }
    }

    private AbstractCard getCard(){
        return cardsToPreview;
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeBlock(4);
            this.cardsToPreview.upgrade();
            setFireDescription(cardStrings.EXTENDED_DESCRIPTION[1]);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}


